#include<bits/stdc++.h>

using namespace std;

int main() {
    int a, b, c, n;
    for (a = 1; a <= 4; a++)
        for (b = 1; b <= 4; b++) {
            if (a == b)continue;
            for (c = 1; c <= 4; c++) {
                if (c == a || c == b)continue;
                cout << a << b << c << endl;
            }
        }


    return 0;
}

